package com.shujia.day08;


class A {
    int a  = 10;

    public void fun(){
        System.out.println("A");
    }
}

class B extends A {
    int a = 100;
    public void fun(){
        System.out.println("B");
    }
}


class C extends A {
    public void fun(){
        System.out.println("C");
    }
}

public class Test {
    public static void main(String[] args) {

//        useFun2(new B());
//        useFun3(new C());

        useFun(new A());
        useFun(new C());
        useFun(new B());

        A a = new B();

        System.out.println(a.a);

//        new Code02Modifier();

    }
    public static void useFun(A a){
        a.fun();
    }

//    public static void useFun2(B b){
//        b.fun();
//    }



//    public static void useFun3(C c){
//        c.fun();
//    }

}


